﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LibraryO2S;
public partial class Administrator_ModuleAdd : System.Web.UI.Page
{


    BizModule report = new BizModule();

    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int status = 0;
        if (cbStatus.Checked)
        {
            status = 1;
        }
        else
            status = 0;
        try
        {
            string createdby = Session["USERNAME"].ToString();
            // report.Insert(txtTitle.Text, txtDescription.Text, txtURL.Text, DateTime.Parse(txtStartDate.Text), DateTime.Parse(txtEndDate.Text), DateTime.Now, createdby);

            report.Insert(txtModuleName.Text, txtDescription.Text, int.Parse(txtSortDisplay.Text), createdby, status);
            divMessage.InnerHtml = O2S_Message.Success("Hệ thống", "Thực hiện thành công");
            txtModuleName.Text = "";
            txtDescription.Text = "";
            txtSortDisplay.Text = "";
            cbStatus.Checked = false;


        }
        catch (Exception ex)
        {
            divMessage.InnerHtml = O2S_Message.Error("Hệ thống", "Phát hiện lỗi" + ex.Message);
        }

    }
}